CFLAGS=
CPPFLAGS=/D "_WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_CRT_SECURE_NO_WARNINGS" /D "_UNICODE" /D "UNICODE" 
LDFLAGS=/LIBPATH:debug/
LIBS=user32.lib kernel32.lib comctl32.lib 

OBJS=main.obj

default: DEMO_EXE

DEMO_EXE: $(OBJS)
    @if not exist debug ( mkdir debug )
    @link /nologo /DEBUG /MACHINE:X64 /MANIFEST:NO /OUT:debug\demo.exe /PDB:debug\demo.pdb /SUBSYSTEM:CONSOLE $(LDFLAGS) $(OBJS) $(LIBS)

DEMO_DLL: $(OBJS)
    @if not exist debug ( mkdir debug )
    @link /nologo /DEBUG /DLL /MACHINE:X64 /MANIFEST:NO /OUT:debug\libdemo.dll /IMPLIB:debug\libdemo.lib /PDB:debug\libdemo.pdb /SUBSYSTEM:CONSOLE $(LDFLAGS) $(OBJS) $(LIBS)

.cpp.obj:
    @if not exist debug ( mkdir debug )
    @cl /nologo /ZI /EHsc /W3 /MDd /W3 /c $(CPPFLAGS) /Fd:debug\ /Fo:debug\ $*.cpp
    @echo compile $@ finished.

clean:
    @if exist debug ( rd /s /q debug )